package 项目管理;
import java.util.ArrayList;
import java.util.Scanner;
public interface ISignUp {
	// 打印输出结果
    public void print();
    // 检查是否有 stuType对应的班级名额
    // 如果没有剩余名额，请返回 false ，否则学生将报名进入该班级并返回 true
    public boolean addStudent (int stuType);
    // 解析命令行输入的参数（格式），如文档描述
public static IParams parse() throws Exception{
	IParams pr=new IParams() {
		int big=0;
		int medium=0;
		int small=0;
		ArrayList<Integer>Plan=new ArrayList<>();
		public int getBig() {//大班获取
			return big;
		}
		public int getMedium() {
			return medium;
		}
		public int getSmall() {
			return small;
		}
		public void add(int i){
            Plan.add(i);
        }
		public void set(int big,int medium,int small) {
            this.big=big;
            this.medium=medium;
            this.small=small;
        }
		public ArrayList<Integer> getPlanSignUp() {
			return Plan;
		}
	};
	int k=0,sum=0;
    Scanner sc=new Scanner(System.in);
    String school=sc.nextLine(),register,car_num,add_num,temp;
    while((k=school.indexOf( "addstudent",k))!=-1){
        sum++;
        k+=2;
    }
    register=sc.nextLine();
    car_num=register.substring(2,register.indexOf("]",2));
    car_num=car_num+",";
    k=0;
    int[] num =new int[3];
    for(int i=0;i<3;i++){
        temp=car_num.substring(k,car_num.indexOf(",",k)).trim();
        k=car_num.indexOf(",",k)+1;
        num[i]=Integer.parseInt(temp);
    }
    pr.set(num[0],num[1],num[2]);
    add_num=register.substring(register.indexOf("]",2)+1,register.length()-1);
    k=0;int j=0;
    for(int i=0;i<add_num.length();i++){
        if(add_num.charAt(i)>='1'&&add_num.charAt(i)<='3'){
            j++;
            pr.add(add_num.charAt(i)-48);
        }
    }
    sc.close();
	return pr;
 };
}
